package com.supor.aiot.mine.api;

import com.android.baseconfig.base.BaseApiResult;
import com.supor.aiot.common.app.Constants;
import com.supor.aiot.mine.bean.RecipeApplyBean;

import java.util.List;

import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * @author Xiaozhuang
 * @date 2021/10/18
 *
 * @description 食谱创作接口
 */
public interface RecipeCreateService {

    /**
     *
     * 添加用户食谱创作申请数据
     *
     * @param recipeApplyBean recipeApplyBean
     * @return Observable<BaseApiResult<RecipeApplyBean>>
     */
    @POST(Constants.OSS_API + "bossTRecipeApply")
    Observable<BaseApiResult<RecipeApplyBean>> addRecipeApply(@Body RecipeApplyBean recipeApplyBean);

    /**
     *
     * 撤销申请
     *
     * @param applyId 创作申请主键
     * @return Observable<BaseApiResult<String>>
     */
    @POST(Constants.OSS_API + "bossTRecipeApply/del/{id}")
    Observable<BaseApiResult<String>> deleteRecipeApply(@Path("id") String applyId);

    /**
     *
     * 判断用户是不是已经申请了
     *
     * @return Observable<BaseApiResult<String>>
     */
    @GET(Constants.OSS_API + "bossTRecipeApply/isApply")
    Observable<BaseApiResult<String>> getApplyStatus();


    /**
     *
     * 查询所有记录，不分页
     *
     * @return Observable<BaseApiResult<List<RecipeApplyBean>>>
     */
    @GET(Constants.OSS_API + "bossTRecipeApply/all")
    Observable<BaseApiResult<List<RecipeApplyBean>>> getApplyAll();

}
